#include <cstdio>
#include <string.h>
#include "Logger.h"
#include "OnTestMsg.h"
#include "ServerApplication.h"
#include "TestEngine.h"
using namespace xncc::user;

int main(int argc, const char** argv)
{
    std::string cfgFile;
    if (argc >= 3) {
        if (strncasecmp(argv[1], "-f", 2) == 0 || strncasecmp(argv[1], "--file", 6) == 0) {
            cfgFile = argv[2];
        }
    }
    ServerApplication server(cfgFile);
    printf("cfg_file:%s\n", cfgFile.c_str());
    server.addEventengine(std::make_shared<TestEngine>(1));
    server.addEventengine(std::make_shared<TestEngine>(2));
    server.run(argc, argv);
    return 0;
}